package com.sq.es;



import com.sq.es.templete.ElasticSearchConnectionTemplete;
import com.sq.es.templete.ElasticSearchDocTemplete;
import com.sq.es.templete.ElasticSearchIndexTemplete;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author Li sir
 * @Date 2024/1/8
 */
@Component
public class ElasticSearchManager  {


    @Autowired
    private ElasticSearchConnectionTemplete elasticSearchConnectionTemplete;

    @Autowired
    private ElasticSearchIndexTemplete elasticSearchIndexTemplete;

    @Autowired
    private ElasticSearchDocTemplete elasticSearchDocTemplete;

    public  RestHighLevelClient getClient(){
        RestHighLevelClient connection = elasticSearchConnectionTemplete.getConnection();
        return connection;
    }

    public ElasticSearchIndexTemplete getElasticSearchIndexTemplete(){
        return elasticSearchIndexTemplete;
    }

    public ElasticSearchDocTemplete getelasticSearchDocTemplete(){
        return elasticSearchDocTemplete;
    }

}
